home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
comm
/
news
/
amitin119a.lha
/
tin119.diffs
< prev
Wrap
Text File
|
1993-04-12
|
17KB
|
636 lines
diff -c2 tin/active.c newtin/active.c
*** tin/active.c Fri Mar 23 12:25:14 19101
--- newtin/active.c Sat Apr 03 08:23:26 1993
***************
*** 21,24 ****
--- 21,41 ----
int active_index = -1;
+ #ifdef AMIGA
+
+ /* Finds the number of groups as set by actived. Helps to eliminate
+ wasted memory being allocated. */
+
+ int get_active_num()
+ {
+ char *str;
+ int num;
+ if ((str = getenv("TIN_GROUPS")) == 0)
+ return DEFAULT_ACTIVE_NUM;
+ num = atoi(str);
+ return num ? num : DEFAULT_ACTIVE_NUM;
+ }
+
+ #endif
+
/*
* Resync active file when SIGALRM signal received that
***************
*** 37,41 ****
--- 54,62 ----
}
free_active_arrays ();
+ #ifdef AMIGA
+ max_active = get_active_num();
+ #else
max_active = DEFAULT_ACTIVE_NUM;
+ #endif
expand_active ();
read_mail_active_file ();
***************
*** 214,218 ****
--- 235,243 ----
*/
active[num_active].type = GROUP_TYPE_NEWS;
+ #ifdef AMIGA
+ active[num_active].name = active_str_dup(buf);
+ #else
active[num_active].name = str_dup (buf);
+ #endif
active[num_active].spooldir = spooldir;
active[num_active].description = (char *) 0;
diff -c2 tin/actived.c newtin/actived.c
*** tin/actived.c Fri Mar 23 12:25:14 19101
--- newtin/actived.c Sat Apr 03 13:16:04 1993
***************
*** 28,31 ****
--- 28,33 ----
FILE *fp, *ng, *active;
long x;
+ long numgroups = 0;
+ char buf[20];
if ((ng = fopen (NEWSGROUPS_FILE, "r")) == (FILE *) 0) {
***************
*** 60,64 ****
x = 0;
}
! fprintf (active, "%s %05d 00001 y\n", groupname, x);
}
}
--- 62,71 ----
x = 0;
}
! fprintf (active, "%s %05ld 00001 y\n", groupname, x);
! numgroups++;
}
+ fclose(ng);
+
+ sprintf(buf,"%d",numgroups+1);
+ setenv("TIN_GROUPS",buf);
}
diff -c2 tin/feed.c newtin/feed.c
*** tin/feed.c Fri Mar 23 12:25:24 19101
--- newtin/feed.c Sun Mar 28 12:57:08 1993
***************
*** 508,516 ****
break;
case FEED_SAVE:
- #ifndef AMIGA
if (proc_ch != 'n' && is_mailbox == FALSE) {
ret2 = post_process_files (proc_ch);
}
- #endif
free_save_array ();
break;
--- 508,514 ----
diff -c2 tin/hashstr.c newtin/hashstr.c
*** tin/hashstr.c Fri Mar 23 12:25:26 19101
--- newtin/hashstr.c Sat Apr 03 08:53:45 1993
***************
*** 81,88 ****
struct hashnode *p;
p = (struct hashnode *) my_malloc ((unsigned) sizeof (struct hashnode));
- p->next = (struct hashnode *) 0;
iptr = (int *) my_malloc ((unsigned) strlen (s) + sizeof (int) + 1);
*iptr++ = -1;
p->s = (char *) iptr;
--- 81,94 ----
struct hashnode *p;
+ #ifdef AMIGA
+ p = (struct hashnode *) pool_malloc(1, (unsigned) sizeof (struct hashnode)
+ + strlen(s) + sizeof (int) + 1);
+ iptr = (int *) &p[1];
+ #else
p = (struct hashnode *) my_malloc ((unsigned) sizeof (struct hashnode));
iptr = (int *) my_malloc ((unsigned) strlen (s) + sizeof (int) + 1);
+ #endif
+ p->next = (struct hashnode *) 0;
*iptr++ = -1;
p->s = (char *) iptr;
***************
*** 110,113 ****
--- 116,120 ----
for (i = 0; i < HASHNODE_TABLE_SIZE; i++)
if (table[i] != (struct hashnode *) 0) {
+ #ifndef AMIGA
p = table[i];
while (p != (struct hashnode *) 0) {
***************
*** 121,125 ****
--- 128,136 ----
p = next;
}
+ #endif
table[i] = (struct hashnode *) 0;
}
+ #ifdef AMIGA
+ pool_free(1);
+ #endif
}
diff -c2 tin/help.c newtin/help.c
*** tin/help.c Fri Mar 23 12:25:26 19101
--- newtin/help.c Tue Mar 23 12:08:16 1993
***************
*** 360,364 ****
void display_info_page ()
{
! char buf[PATH_LEN];
int i, help_lines;
--- 360,364 ----
void display_info_page ()
{
! char buf[LEN];
int i, help_lines;
diff -c2 tin/init.c newtin/init.c
*** tin/init.c Fri Mar 23 12:25:28 19101
--- newtin/init.c Mon Mar 29 05:04:38 1993
***************
*** 330,334 ****
--- 330,338 ----
strcpy (spooldir_alias, "news");
strcpy (spooldir, SPOOLDIR);
+ #ifdef AMIGA
+ strcpy (mailer, get_val ("TIN_MAIL", DEFAULT_MAILER));
+ #else
strcpy (mailer, get_val ("MAILER", DEFAULT_MAILER));
+ #endif /* AMIGA */
strcpy (default_printer, DEFAULT_PRINTER);
strcpy (quote_chars, DEFAULT_COMMENT);
diff -c2 tin/lang.c newtin/lang.c
*** tin/lang.c Fri Mar 23 12:25:29 19101
--- newtin/lang.c Sun Mar 28 13:37:41 1993
***************
*** 33,37 ****
--- 33,41 ----
char txt_purge[] = "Purging %s...";
char txt_cannot_open_art[] = "Can't open article %s: ";
+ #ifdef DONT_HAVE_SELECT
+ char txt_indexing_num[] = "Indexing %s...%4d/%d";
+ #else
char txt_indexing_num[] = "Indexing %s ('q' to quit)...%4d/%d";
+ #endif
char txt_corrupt_index[] = "Index file %s corrupted. error %d on article %d";
char txt_checking_for_news[] = "Checking for news...";
***************
*** 49,53 ****
char txt_art_thread_regex_tag[] = " a)rticle, t)hread, h)ot, p)attern, T)agged articles, q)uit: ";
#ifdef AMIGA
! char txt_post_process_type[] = "Process n)one, s)har, u)ud, l)ist lha, e)xt lha, L)ist zip, E)xt zip, q)uit: ";
#else
char txt_post_process_type[] = "Process n)one, s)har, u)ud, l)ist zoo, e)xt zoo, L)ist zip, E)xt zip, q)uit: ";
--- 53,57 ----
char txt_art_thread_regex_tag[] = " a)rticle, t)hread, h)ot, p)attern, T)agged articles, q)uit: ";
#ifdef AMIGA
! char txt_post_process_type[] = "Process n)one, s)har, u)ud, q)uit: ";
#else
char txt_post_process_type[] = "Process n)one, s)har, u)ud, l)ist zoo, e)xt zoo, L)ist zip, E)xt zip, q)uit: ";
***************
*** 112,116 ****
--- 116,124 ----
char txt_art_posted[] = "Article posted";
char txt_art_rejected[] = "Article rejected (saved to %s)";
+ #ifdef HAVE_ISPELL
char txt_quit_edit_post[] = "q)uit, e)dit, i)spell, p)ost: ";
+ #else
+ char txt_quit_edit_post[] = "q)uit, e)dit, p)ost: ";
+ #endif
char txt_help_4[] = "4$ Goto spooldir 4 ($=goto last spooldir)\r\n";
char txt_help_i_4[] = "4$ Goto article 4 ($=goto last article)\r\n";
***************
*** 332,336 ****
--- 340,348 ----
char txt_no_mail_address[] = "No mail address";
char txt_no_responses[] = "No responses";
+ #ifdef HAVE_ISPELL
char txt_quit_edit_ispell_send[] = "q)uit, e)dit, i)spell, s)end";
+ #else
+ char txt_quit_edit_ispell_send[] = "q)uit, e)dit, s)end";
+ #endif
char txt_quit_edit_send[] = "q)uit, e)dit, s)end";
char txt_quit_edit_delete[] = "q)uit, e)dit, d)elete";
Only in newtin: lang.o
diff -c2 tin/mail.c newtin/mail.c
*** tin/mail.c Fri Mar 23 12:25:29 19101
--- newtin/mail.c Sat Apr 03 08:34:34 1993
***************
*** 237,241 ****
--- 237,245 ----
if (i >= 0 && active[i].description == (char *) 0) {
+ #ifdef AMIGA
+ active[i].description = active_str_dup (p);
+ #else
active[i].description = str_dup (p);
+ #endif
if (active[i].type == GROUP_TYPE_NEWS) {
if (fp_save && read_news_via_nntp &&
diff -c2 tin/memory.c newtin/memory.c
*** tin/memory.c Fri Mar 23 12:25:29 19101
--- newtin/memory.c Sat Apr 03 08:42:31 1993
***************
*** 57,61 ****
--- 57,65 ----
* active file arrays
*/
+ #ifdef AMIGA
+ max_active = get_active_num();
+ #else
max_active = DEFAULT_ACTIVE_NUM;
+ #endif
max_active_size = DEFAULT_ACTIVE_SIZE_NUM;
***************
*** 316,320 ****
--- 320,328 ----
if (active != (struct group_t *) 0) { /* active[] */
+ #ifdef AMIGA
+ pool_free(0);
+ #endif
for (i=0 ; i < num_active ; i++) {
+ #ifndef AMIGA
if (active[i].name != (char *) 0) {
free ((char *) active[i].name);
***************
*** 325,328 ****
--- 333,337 ----
active[i].description = (char *) 0;
}
+ #endif
if (active[i].type == GROUP_TYPE_MAIL &&
active[i].spooldir != (char *) 0) {
***************
*** 468,469 ****
--- 477,540 ----
return p;
}
+
+ #ifdef AMIGA
+
+ /* Allocate memory in blocks of 4096 for strings. This means there are
+ fewer calls made to malloc() and free(). Hopefully this should speed
+ things up a little... */
+
+ #define STR_ALLOC_SIZE 4096
+
+ struct str_list
+ { struct str_list *next;
+ char *strptr;
+ };
+
+ struct pool
+ { int avail;
+ struct str_list *first, *cur;
+ } pools[2] = {{0,0,0},{0,0,0}};
+
+ char *pool_malloc(pn, size)
+ { struct pool *pp;
+ char *cp;
+
+ pp = &pools[pn];
+ size = ~3L & (size + 3);
+
+ if (pp->avail < size)
+ { if (pp->first == 0)
+ { pp->first = pp->cur = (struct str_list *)my_malloc(STR_ALLOC_SIZE + sizeof(struct str_list));
+ } else
+ { pp->cur->next = (struct str_list *)my_malloc(STR_ALLOC_SIZE + sizeof(struct str_list));
+ pp->cur = pp->cur->next;
+ }
+ pp->cur->strptr = (char *) &pp->cur[1];
+ pp->cur->next = 0;
+ pp->avail = STR_ALLOC_SIZE;
+ }
+ cp = pp->cur->strptr;
+ pp->avail -= size;
+ pp->cur->strptr = cp + size;
+
+ return cp;
+ }
+
+ void pool_free(pn)
+ { struct str_list *p,*next;
+ struct pool *pp;
+
+ pp = &pools[pn];
+
+ if ((p = pp->first) == 0) return;
+
+ for (; p; p = next)
+ { next = p->next;
+ free (p);
+ }
+
+ pp->first = pp->cur = 0;
+ pp->avail = 0;
+ }
+
+ #endif /* AMIGA */
diff -c2 tin/misc.c newtin/misc.c
*** tin/misc.c Fri Mar 23 12:25:30 19101
--- newtin/misc.c Sat Apr 03 08:42:22 1993
***************
*** 381,384 ****
--- 381,398 ----
}
+ #ifdef AMIGA
+
+ char *active_str_dup (char *str)
+ {
+ char *dup = (char *) 0;
+
+ if (str) {
+ dup = pool_malloc(0, strlen (str)+1);
+ strcpy (dup, str);
+ }
+ return dup;
+ }
+
+ #endif /* AMIGA */
int invoke_cmd (nam)
diff -c2 tin/post.c newtin/post.c
*** tin/post.c Fri Mar 23 12:25:33 19101
--- newtin/post.c Sat Apr 03 08:45:14 1993
***************
*** 66,71 ****
posted[i].action = buf[j];
j += 2;
! for (k=j,j=0 ; buf[k] != '|' && buf[k] != ',' ; k++, j++) {
! posted[i].group[j] = buf[k];
}
if (buf[k] == ',') {
--- 66,71 ----
posted[i].action = buf[j];
j += 2;
! for (k=j,j=0 ; buf[k] != '|' && buf[k] != ',' ; k++) {
! if (j < 75) posted[i].group[j++] = buf[k];
}
if (buf[k] == ',') {
***************
*** 80,85 ****
posted[i].group[j++] = '\0';
k++;
! for (j=k,k=0 ; buf[j] != '\n' ; j++, k++) {
! posted[i].subj[k] = buf[j];
}
posted[i].subj[k++] = '\0';
--- 80,85 ----
posted[i].group[j++] = '\0';
k++;
! for (j=k,k=0 ; buf[j] != '\n' ; j++) {
! if (k < 119) posted[i].subj[k++] = buf[j];
}
posted[i].subj[k++] = '\0';
***************
*** 873,877 ****
wait_message (msg);
#ifdef AMIGA
! sprintf (buf, "%s <%s -f %s", mailer, nam, userid);
#else
sprintf (buf, "%s \"%s\" < %s", mailer, mail_to, nam);
--- 873,877 ----
wait_message (msg);
#ifdef AMIGA
! sprintf (buf, mailer, nam, userid, mail_to);
#else
sprintf (buf, "%s \"%s\" < %s", mailer, mail_to, nam);
***************
*** 975,979 ****
#endif
fprintf (fp, "\nCFG1: active=%d arts=%d reread=%d longfilenames=%d setuid=%d\n",
! DEFAULT_ACTIVE_NUM,
DEFAULT_ARTICLE_NUM,
reread_active_file_secs,
--- 975,979 ----
#endif
fprintf (fp, "\nCFG1: active=%d arts=%d reread=%d longfilenames=%d setuid=%d\n",
! max_active,
DEFAULT_ARTICLE_NUM,
reread_active_file_secs,
***************
*** 1023,1027 ****
wait_message (msg);
#ifdef AMIGA
! sprintf (buf, "%s <%s -f %s", mailer, nam, userid);
#else
sprintf (buf, "%s \"%s\" < %s", mailer, mail_to, nam);
--- 1023,1027 ----
wait_message (msg);
#ifdef AMIGA
! sprintf (buf, mailer, nam, userid, mail_to);
#else
sprintf (buf, "%s \"%s\" < %s", mailer, mail_to, nam);
***************
*** 1126,1130 ****
insert_x_headers (nam);
#ifdef AMIGA
! sprintf (buf, "%s <%s -f %s", mailer, nam, userid);
#else
sprintf (buf, "%s \"%s\" < %s", mailer, mail_to, nam);
--- 1126,1130 ----
insert_x_headers (nam);
#ifdef AMIGA
! sprintf (buf, mailer, nam, userid, mail_to);
#else
sprintf (buf, "%s \"%s\" < %s", mailer, mail_to, nam);
***************
*** 1491,1496 ****
#ifdef AMIGA
! sprintf (cp, "uucp:c/postnews %s", name);
! #else
# ifdef INEWSDIR
strcpy (buf, INEWSDIR);
--- 1491,1501 ----
#ifdef AMIGA
! { char *p;
! if ((p = getenv("TIN_POST")) != (char *)0)
! sprintf (cp, p, name);
! else
! sprintf (cp, "uucp:c/postnews %s", name);
! }
! #else
# ifdef INEWSDIR
strcpy (buf, INEWSDIR);
***************
*** 1590,1594 ****
--- 1595,1603 ----
{
if (reread_active_for_posted_arts) {
+ #ifndef AMIGA
+ /* The active file on the Amiga is not updated until actived is re-run */
+ /* so there's no point in re-readint it. */
yank_active_file ();
+ #endif
reread_active_for_posted_arts = FALSE;
}
diff -c2 tin/proto.h newtin/proto.h
*** tin/proto.h Fri Mar 23 12:25:34 19101
--- newtin/proto.h Sat Apr 03 08:49:40 1993
***************
*** 152,155 ****
--- 152,159 ----
extern char *my_malloc(unsigned size);
extern char *my_realloc(char *p, unsigned size);
+ #ifdef AMIGA
+ extern char *pool_malloc(int pool, int size);
+ extern void pool_free(int pool);
+ #endif
/* misc.c */
extern void asfail(char *file, int line, char *cond);
***************
*** 163,166 ****
--- 167,173 ----
extern void rename_file(char *old_filename, char *new_filename);
extern char *str_dup(char *str);
+ #ifdef AMIGA
+ extern char *active_str_dup(char *str);
+ #endif
extern int invoke_cmd(char *nam);
extern void draw_percent_mark(int cur_num, int max_num);
***************
*** 564,567 ****
--- 571,578 ----
extern char *my_malloc(/*unsigned size*/);
extern char *my_realloc(/*char *p, unsigned size*/);
+ #ifdef AMIGA
+ extern char *pool_malloc(/*int pool, int size*/);
+ extern void pool_free(/*int pool*/);
+ #endif
/* misc.c */
extern void asfail(/*char *file, int line, char *cond*/);
***************
*** 575,578 ****
--- 586,592 ----
extern void rename_file(/*char *old_filename, char *new_filename*/);
extern char *str_dup(/*char *str*/);
+ #ifdef AMIGA
+ extern char *active_str_dup(/*char *str*/);
+ #endif
extern int invoke_cmd(/*char *nam*/);
extern void draw_percent_mark(/*int cur_num, int max_num*/);
diff -c2 tin/save.c newtin/save.c
*** tin/save.c Fri Mar 23 12:25:35 19101
--- newtin/save.c Mon Mar 29 05:53:11 1993
***************
*** 193,198 ****
if (check_start_save == MAIL_ANY_NEWS) {
#ifdef AMIGA
! sprintf (buf, "%s <%s -f %s",
! mailer, savefile, userid);
#else
sprintf (buf, "%s \"%s\" < %s", mailer,
--- 193,197 ----
if (check_start_save == MAIL_ANY_NEWS) {
#ifdef AMIGA
! sprintf (buf, mailer, savefile, userid, mail_news_user);
#else
sprintf (buf, "%s \"%s\" < %s", mailer,
***************
*** 260,264 ****
}
#ifdef AMIGA
! sprintf (buf, "%s <%s -f %s", mailer, logfile, userid);
#else
sprintf (buf, "%s \"%s\" < %s", mailer,
--- 259,264 ----
}
#ifdef AMIGA
! sprintf (buf, mailer, logfile, userid,
! (check_start_save == MAIL_ANY_NEWS ? mail_news_user : userid));
#else
sprintf (buf, "%s \"%s\" < %s", mailer,
***************
*** 1060,1064 ****
--- 1060,1075 ----
wait_message (txt_uudecoding);
+ #ifdef AMIGA
+ { char currentdir[128];
+ getcwd(currentdir,128);
+ chdir(file_out_dir);
+ sprintf (buf, "uudecode %s", file_out);
+ invoke_cmd (buf);
+ chdir(currentdir);
+ }
+ #else
+
sprintf (buf, "cd %s; uudecode %s", file_out_dir, file_out);
+
if (invoke_cmd (buf)) {
/*
***************
*** 1134,1137 ****
--- 1145,1149 ----
}
}
+ #endif
delete_processed_files ();
***************
*** 1213,1216 ****
--- 1225,1237 ----
fclose (fp_out);
+ #ifdef AMIGA
+ { char currentdir[128];
+ getcwd (currentdir,128);
+ chdir (file_out_dir);
+ sprintf (buf, "unshar %s", file_out);
+ invoke_cmd (buf);
+ chdir (currentdir);
+ }
+ #else
sprintf (buf, "cd %s; sh %s", file_out_dir, file_out);
fputs ("\r\n", stdout);
***************
*** 1219,1222 ****
--- 1240,1244 ----
invoke_cmd (buf);
Raw (TRUE);
+ #endif
unlink (file_out);
}
diff -c2 tin/tin.h newtin/tin.h
*** tin/tin.h Fri Mar 23 12:25:41 19101
--- newtin/tin.h Mon Mar 29 05:51:16 1993
***************
*** 268,275 ****
# ifdef AMIGA
# define DEFAULT_EDITOR "c:ed"
! # define DEFAULT_MAILER "uucp:c/sendmail"
# define DEFAULT_MAILBOX "uumail:"
# define DEFAULT_PRINTER "c:type" /* Not Yet Implemented */
! # define DEFAULT_SHELL "c:newshell"
# endif
# ifdef __hpux
--- 268,275 ----
# ifdef AMIGA
# define DEFAULT_EDITOR "c:ed"
! # define DEFAULT_MAILER "uucp:c/sendmail <%s -f %s"
# define DEFAULT_MAILBOX "uumail:"
# define DEFAULT_PRINTER "c:type" /* Not Yet Implemented */
! # define DEFAULT_SHELL "c:newshell" /* Neither is this */
# endif
# ifdef __hpux